<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>jquery 动画</title>
	<script type="text/javascript" src="../js/jquery-1.12.4.min.js"></script>
	<script type="text/javascript">
		
		$(function(){

			/*
			 参数:
				1.属性设置{pra1:1,pra2:2}
			 	2.speed 时间 ms
			 	3.swing 默认值开始和结束慢速,中间快速,类似于样式动画的ease  linear匀速
			 	4.回调函数

			*/
			$('#div1').animate({width:200,height:200},1000,function(){
				//alert('动画播放结束!');
				$(this).animate({marginLeft:500},1000,'linear',function(){
					$(this).animate({marginTop:500},1000);
				});
			})

		})

	</script>
	<style type="text/css">
		.box{
			width: 100px;
			height: 100px;
			background-color: gold;
		}
	</style>
</head>
<body>
	<!-- class给样式来用，id给程序来用 -->
	<div class="box" id="div1"></div>
</body>
</html>